home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 2 (Reseller) / Apple R&P Lib Reseller v2.0.iso / 4-Fonts & Software / Demo Software / AppMaker / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpP_208_ModalDialog.txt < prev    next >
Encoding:
Text File  |  1989-04-09  |  1.2 KB  |  83 lines

  1. # (decoded with TMPL 11972)
  2. { %filename% -- Modal dialog }
  3. { Created %date% %time% by AppMaker }
  4.  
  5. Unit %unitname%;
  6. Interface
  7.  
  8. Uses
  9. %If MPW%
  10.     {$Load ToolBox.dump}
  11.         MemTypes,
  12.         QuickDraw,
  13.         OSIntf,
  14.         ToolIntf,
  15.         PackIntf,
  16.     {$Load}
  17.  
  18. %end if%
  19. %If Think%
  20. {$ifc undefined Think_Pascal}
  21.     ListManager,
  22. {$endc}
  23. %end if%
  24.     ResourceDefs,
  25.     DialogAids;
  26.  
  27. Type
  28.     %dlogname%Rec = record
  29.         %DeclItems%
  30.     end;
  31.  
  32. {----------}
  33. Function Get%dlogname% (var %dlogname%:    %dlogname%Rec): boolean;
  34.  
  35. {----------}
  36. Implementation
  37.  
  38. %If MPW%
  39. {$D+}
  40. {$R+}
  41. {$OV+}
  42.  
  43. %end if%
  44. const
  45.     %ConstItems%
  46.  
  47. %If MPW%
  48. {$S %unitname%}
  49.  
  50. %end if%
  51. %ItemProcs%
  52. %MaybeFilter%
  53. {----------}
  54. Function Get%dlogname% {(var %dlogname%:    %dlogname%Rec): boolean};
  55. var
  56.     result:            boolean;
  57.     theDialog:        DialogPtr;
  58.     done:            boolean;
  59.     itemNr:            integer;
  60. Begin
  61.     InitCursor;
  62.     theDialog := GetNewDialog (%dlogname%ID, nil, pointer (-1));
  63.     SetPort (theDialog);
  64.     with %dlogname% do begin
  65.         %SetItems%
  66.         ShowWindow (theDialog);
  67.         OutlineButton (1);
  68.         done := false;
  69.         while not done do begin
  70.             %EnableItems%
  71.             ModalDialog (%Filtername%, itemNr);
  72.             case itemNr of
  73.                 %HandleItems%
  74.             end; {case}
  75.         end; {while}
  76.         %FinishItems%
  77.     end; {with}
  78.     DisposDialog (theDialog);
  79.     Get%dlogname% := result;
  80. End; {Get%dlogname%}
  81.  
  82. End. {%unitname%}
  83.